import java.util.Scanner;

/*
     求取最高分最低分和平均分
 */
public class WorkTest120303 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int[] arr = new int[5];
        int sum = 0;
        //建立循环录入
        for (int i = 0; i < arr.length; i++) {
            System.out.println("老师给定的第" + (i + 1) + "门分数为:");
            arr[i] = sc.nextInt();
            sum += arr[i];
        }
        int max = arr[0];
        int min = arr[0];
        //遍历求最值
        for (int i = 1; i < arr.length; i++) {
            if (max < arr[i]) {
                max = arr[i];
            }
            if (min > arr[i]) {
                min = arr[i];
            }
        }
        int ave = sum / 5;
        System.out.println("小明的平均分为:" + ave);
        System.out.println("小明的最高分为:" + max);
        System.out.println("小明的最低分为:" + min);
    }
}
